package com.cqjtu.graduation.service;
import com.cqjtu.graduation.entity.FoodTypeDO;
import com.cqjtu.graduation.service.impl.FoodTypeDOServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath:config/application-*.xml")
public class testFoodTypeDOService {
    @Autowired
    private FoodTypeDOServiceImpl foodTypeDOService;

    @Test
    public void testListFoodTypeInfo(){
//        System.out.println(foodTypeDOService.listFoodTypeInfo());
    }

    @Test
    public void testSaveFoodTypeInfo(){
        FoodTypeDO foodTypeDO=new FoodTypeDO();
        foodTypeDO.setFoodtypeName("回锅肉火锅");
        foodTypeDO.setFoodtypeDetail("233");
        foodTypeDO.setFoodtypeIntroduction("233");
        foodTypeDO.setFoodtypeIsrecommend(1);
        foodTypeDO.setFoodtypePrice(188f);
        foodTypeDO.setFoodtypeId(5);
        foodTypeDOService.updataFoodTypeInfo(foodTypeDO);
    }
    @Test
    public void testDeleteFoodTypeInfo(){
        foodTypeDOService.deleteFoodTypeInfo(3);
    }
}
